﻿using Ewell.BizComponent.Charge.UI.VM;
using FunnyArts.Wpf.ControlLibrary.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Ewell.BizComponent.Charge.UI
{
    /// <summary>
    /// CashierMain.xaml 的交互逻辑
    /// </summary>
    public partial class CashierMainFrm : Window
    {
        public CashierMainVm vm { get; set; }
        public CashierMainFrm()
        {
            InitializeComponent();
            this.Topmost = true;
        }

        public CashierMainFrm(CashierMainVm vm):this()
        {
            this.vm = vm;
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            frame.Content = this.vm.currentStep.page;
            frame.Content = new CashierNewFrm(new CashierNewVm());
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            CashierStepVm cashierStep = this.vm.currentStep;
            cashierStep.stepLoading.Invoke(cashierStep.context);
            this.DataContext = vm;
        }
    }
}
